Implement x-www-form-urlencoded validation#237
Implement x-www-form-urlencoded validation#237ySnoopyDogy wants to merge 9 commits intopb33f:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #237 +/- ##
==========================================
+ Coverage 97.63% 97.86% +0.22%
==========================================
Files 56 60 +4
Lines 5323 5848 +525
==========================================
+ Hits 5197 5723 +526
+ Misses 126 125 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I need to add this to the docs, but I generally will hold all PRs that don't have full coverage, unless there is a solid reason. In this case, your code is solid! But some error paths have been uncovered. I know they are a pain to cover. The problem is that every slight drop in coverage compounds with every submission. I am responsible for this code once it's merged, and I strongly believe in high coverage in core libraries. Sorry to be pedantic, I hope you understand. in this PR there are a few error cases uncovered, a few invalid object or nil tests would bump it up and we can all be happy! |
also added a validation for XML namespaces and prefix
Potentially closes pb33f#180
723b2f9 to
5c9c9c2
Compare
This PR was made on top of #214, and closes #180.
The same idea from the XML validation was used for URLEncoded. We convert the data into a JSON structure matching the types from the Schema, so we can validate the JSON structure against the OpenAPI schema.
Created a new interface
URLEncodedValidatorwith two functions for validating url encoded:ValidateURLEncodedStringandValidateURLEncodedStringWithVersion.Added a new option to ValidationOptions:
AllowURLEncodedBodyValidationto enable URL Encoded validations in request/response bodies (the default is false). Created a function WithURLEncodedBodyValidation to enable the new validator option.No breaking changes with the new code, as the updated function was internal, and the URL Encoded body validation setting is false by default.